﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <!--字体统一渲染模式：平滑ClearType-->
    <!--<Style TargetType="{x:Type Grid}">
        <Setter Property="TextOptions.TextRenderingMode" Value="ClearType" />
        <Setter Property="TextElement.FontSize" Value="13" />
        <Setter Property="TextElement.FontFamily" Value="/Resource/#EUDC,宋体" />
    </Style>-->

    <!--窗体样式-->
    <!--<Style TargetType="{x:Type Window}" x:Key="CommonWindow">
        <Setter Property="Language" Value="zh-CN" />
        <Setter Property="Icon" Value="/FibreCheck;component/Images/logo.png" />
        <Setter Property="Background" Value="AliceBlue"/>
    </Style>-->

    <!--Window窗体淡入效果-->
    <Style TargetType="{x:Type Window}" x:Key="HiddenShowWindow">
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="WindowStyle" Value="None" />
        <Setter Property="AllowsTransparency" Value="True" />
        <Setter Property="Icon" Value="/MiuiThemeMaker;component/Images/Logo.png" />
        <Style.Triggers>
            <EventTrigger RoutedEvent="Loaded">
                <BeginStoryboard>
                    <Storyboard>
                        <DoubleAnimation Storyboard.TargetProperty="Opacity" From="0.01" To="1.00" Duration="0:0:0.3" />
                    </Storyboard>
                </BeginStoryboard>
            </EventTrigger>
        </Style.Triggers>
    </Style>

    <Style TargetType="{x:Type Grid}">
        <Setter Property="Margin" Value="0" />
    </Style>

    <!--TextBlock样式-->
    <Style TargetType="{x:Type TextBlock}">
        <Setter Property="VerticalAlignment" Value="Center" />
        <!--<Setter Property="HorizontalAlignment" Value="Right" />-->
    </Style>

    <!--Separator样式：Heiht作为Separator的高度-->
    <Style TargetType="{x:Type Separator}">
        <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}"/>
        <Setter Property="Margin" Value="0,2,0,2"/>
        <Setter Property="Focusable" Value="false"/>
        <Setter Property="Height" Value="1"/>
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Separator}">
                    <Line Stretch="Fill" X2="1" Stroke="{TemplateBinding Background}" StrokeThickness="{TemplateBinding Height}" StrokeStartLineCap="Square" StrokeEndLineCap="Square"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--Button样式-->
    <Style TargetType="{x:Type Button}">
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="MaxHeight" Value="28" />
        <Setter Property="Margin" Value="3" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <!--常规样式-->
                    <Grid>
                        <Rectangle Name="rectangle" Stroke="#FFBABABA" StrokeThickness="0.5">
                            <Rectangle.Fill>
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                    <GradientStop Color="#FFFBFBFC" Offset="0" />
                                    <GradientStop Color="#FFF1F2F4" Offset="0.5" />
                                    <GradientStop Color="#FFE6E8EC" Offset="1" />
                                </LinearGradientBrush>
                            </Rectangle.Fill>
                        </Rectangle>
                        <AccessText Name="accessText" Text="{TemplateBinding Button.Content}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="16,4" Foreground="#FF555555" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <!--经过时样式-->
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter TargetName="rectangle" Property="Fill">
                                <Setter.Value>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="#FFEBEBEB" Offset="0" />
                                        <GradientStop Color="#FFE1E1E1" Offset="0.5" />
                                        <GradientStop Color="#FFD2D2D2" Offset="1" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                        <!--点击后样式-->
                        <Trigger Property="IsPressed" Value="True">
                            <Setter TargetName="rectangle" Property="Stroke" Value="Black" />
                            <Setter TargetName="rectangle" Property="Fill" Value="DarkOrange" />
                                <!--<Setter.Value>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="#FF1D71AC" Offset="0" />
                                        <GradientStop Color="#FF176199" Offset="0.5" />
                                        <GradientStop Color="#FF114E83" Offset="1" />
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>-->
                            <Setter TargetName="accessText" Property="Foreground" Value="White" />
                            <Setter TargetName="accessText" Property="Margin" Value="17,5,15,3" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type ComboBox}">
        <Setter Property="Margin" Value="2" />
        <Setter Property="Height" Value="26" />
    </Style>

    <Style TargetType="{x:Type PasswordBox}">
        <Setter Property="Margin" Value="2" />
        <Setter Property="Height" Value="26" />
        <!--<Setter Property="BorderThickness" Value="0.5,0.5,1,1.6" />-->
        <Setter Property="BorderBrush" Value="#FF009AD9" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Style.Triggers>
            <Trigger Property="IsFocused" Value="True">
                <Setter Property="BorderBrush" Value="Orange" />
                <Setter Property="Background" Value="{StaticResource commonBackground}" />
            </Trigger>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="BorderBrush" Value="Orange" />
                <Setter Property="Background" Value="#FFF5FFFF" />
            </Trigger>
        </Style.Triggers>
    </Style>
    
    <!--TextBox样式-->
    <Style TargetType="{x:Type TextBox}">
        <Setter Property="Margin" Value="2" />
        <Setter Property="Height" Value="26" />
        <!--<Setter Property="BorderThickness" Value="0.5,0.5,1,1.6" />-->
        <Setter Property="BorderBrush" Value="#FF009AD9" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Style.Triggers>
            <Trigger Property="IsFocused" Value="True">
                <Setter Property="BorderBrush" Value="Orange" />
                <Setter Property="Background" Value="{StaticResource commonBackground}" />
            </Trigger>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="BorderBrush" Value="Orange" />
                <Setter Property="Background" Value="#FFF5FFFF" />
            </Trigger>
            <Trigger Property="IsReadOnly" Value="True">
                <Setter Property="Background" Value="WhiteSmoke" />
                <Setter Property="IsTabStop" Value="False" />
                <Setter Property="Focusable" Value="False" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <!--多行TextBox通用样式-->
    <Style TargetType="{x:Type TextBox}" x:Key="MultiTextBox">
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="BorderBrush" Value="#FF659ECA" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="Background" Value="#E7FFFFFF" />
        <Setter Property="Margin" Value="1" />
        <Setter Property="VerticalContentAlignment" Value="Top" />
        <Setter Property="TextWrapping" Value="Wrap" />
        <Setter Property="VerticalScrollBarVisibility" Value="Auto" />
        <Setter Property="AcceptsReturn" Value="True" />
        <!--回车则换行 lzx 2010.12.15-->
        <Style.Triggers>
            <Trigger Property="IsFocused" Value="True">
                <Setter Property="BorderBrush" Value="Orange" />
                <Setter Property="Background" Value="{StaticResource commonBackground}" />
            </Trigger>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Background" Value="#FFF5FFFF" />
            </Trigger>
            <Trigger Property="IsReadOnly" Value="True">
                <Setter Property="Background" Value="WhiteSmoke" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <!--ListBox样式-->
    <Style TargetType="ListBox">
        <Setter Property="BorderBrush" Value="#BDD4F1"/>
        <Setter Property="BorderThickness" Value="1"/>
        <!--<Setter Property="Background" Value="#F8F7F5"/>-->
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
    </Style>
    <!--ListBoxItem样式-->
    <Style TargetType="ListBoxItem">
        <!--<Setter Property="Foreground" Value="#B5BABF"/>-->
        <Setter Property="OverridesDefaultStyle" Value="True"/>
        <Setter Property="Height" Value="22"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ListBoxItem">
                    <Border Name="back" BorderBrush="#F8F7F5" BorderThickness="0,1,0,1">
                        <Border.Background>
                            <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                                <GradientBrush.GradientStops>
                                    <GradientStopCollection>
                                        <GradientStop Color="White" Offset="0.0"/>
                                        <GradientStop Color="White" Offset="0.5"/>
                                        <GradientStop Color="White" Offset="0.51"/>
                                        <GradientStop Color="White" Offset="1"/>
                                    </GradientStopCollection>
                                </GradientBrush.GradientStops>
                            </LinearGradientBrush>
                        </Border.Background>
                        <ContentPresenter Margin="2" VerticalAlignment="Center"/>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsSelected" Value="True">
                            <Trigger.EnterActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation To="22" Duration="0:0:0.3" Storyboard.TargetProperty="Height"/>
                                        <ColorAnimation To="#F3C37C" Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" />
                                        <ColorAnimation To="#952B00" Duration="0:0:0.2" Storyboard.TargetProperty="(ListBoxItem.Foreground).(SolidColorBrush.Color)" />
                                        <ColorAnimation To="#FFF" Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" />
                                        <ColorAnimation To="#FFEF99" Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" />
                                        <ColorAnimation To="#FFE13F" Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[2].(GradientStop.Color)" />
                                        <ColorAnimation To="#FFF3B0" Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[3].(GradientStop.Color)" />
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.EnterActions>
                            <Trigger.ExitActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation BeginTime="0:0:0.4" Duration="0:0:0.2" Storyboard.TargetProperty="Height"/>
                                        <ColorAnimation Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" />
                                        <ColorAnimation Duration="0:0:0.2" Storyboard.TargetProperty="(ListBoxItem.Foreground).(SolidColorBrush.Color)" />
                                        <ColorAnimation Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" />
                                        <ColorAnimation Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" />
                                        <ColorAnimation Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[2].(GradientStop.Color)" />
                                        <ColorAnimation Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[3].(GradientStop.Color)" />
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.ExitActions>
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Trigger.EnterActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <ColorAnimation To="#D8E6F5" Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" />
                                        <ColorAnimation To="#617A98" Duration="0:0:0.2" Storyboard.TargetProperty="(ListBoxItem.Foreground).(SolidColorBrush.Color)" />
                                        <ColorAnimation To="#F6F9FD" Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" />
                                        <ColorAnimation To="#E0EBF7" Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" />
                                        <ColorAnimation To="#D7E5F6" Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[2].(GradientStop.Color)" />
                                        <ColorAnimation To="#F6F9FD" Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[3].(GradientStop.Color)" />
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.EnterActions>
                            <Trigger.ExitActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <ColorAnimation Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" />
                                        <ColorAnimation Duration="0:0:0.2" Storyboard.TargetProperty="(ListBoxItem.Foreground).(SolidColorBrush.Color)" />
                                        <ColorAnimation Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[0].(GradientStop.Color)" />
                                        <ColorAnimation Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[1].(GradientStop.Color)" />
                                        <ColorAnimation Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[2].(GradientStop.Color)" />
                                        <ColorAnimation Duration="0:0:0.2" Storyboard.TargetName="back" Storyboard.TargetProperty="(Border.Background).(LinearGradientBrush.GradientStops)[3].(GradientStop.Color)" />
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.ExitActions>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <!--GroupBox样式-->
    <Style TargetType="{x:Type GroupBox}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type GroupBox}">
                    <Grid Margin="2">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" MinHeight="30" />
                            <RowDefinition Height="*" />
                        </Grid.RowDefinitions>
                        <Border Grid.Row="0" BorderThickness="0.8,0.6,0.8,0.5" CornerRadius="5,5,0,0">
                            <Border.BorderBrush>
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                    <GradientStop Color="#FF1D71AC" Offset="0" />
                                    <GradientStop Color="#FF176199" Offset="0.5" />
                                    <GradientStop Color="#FF114E83" Offset="1" />
                                </LinearGradientBrush>
                            </Border.BorderBrush>
                            <Border.Background>
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                    <GradientStop Color="#FFFEFEFE" Offset="0" />
                                    <GradientStop Color="#FFF2F2F2" Offset="0.5" />
                                    <GradientStop Color="#FFE0E0E0" Offset="1" />
                                </LinearGradientBrush>
                            </Border.Background>
                            <ContentPresenter Margin="12,4" ContentSource="Header" RecognizesAccessKey="True" VerticalAlignment="Center" />
                        </Border>
                        <Border Grid.Row="1" BorderThickness="0.8,0,0.8,0.8" CornerRadius="0,0,2,2" Background="White">
                            <Border.BorderBrush>
                                <!--<SolidColorBrush Color="#396072" />-->
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                    <GradientStop Color="#FF1D71AC" Offset="0" />
                                    <GradientStop Color="#FF176199" Offset="0.5" />
                                    <GradientStop Color="#FF114E83" Offset="1" />
                                </LinearGradientBrush>
                            </Border.BorderBrush>
                            <!--<Border.Background>
                                <LinearGradientBrush EndPoint="0.5,1" MappingMode="RelativeToBoundingBox" StartPoint="0.5,0">
                                    <GradientStop Color="#91caea" Offset="0" />
                                    <GradientStop Color="#33a2d8" Offset="1" />
                                </LinearGradientBrush>
                            </Border.Background>-->
                            <ContentPresenter Margin="4" />
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--滚动条样式开始-->
    <!--上下左右按钮-->
    <Style x:Key="ScrollBarLineButton" TargetType="{x:Type RepeatButton}">
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="Focusable" Value="false"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RepeatButton}">
                    <Border Name="Border" Margin="1" CornerRadius="2" Background="#EFF3F5" BorderBrush="Gray" BorderThickness="1">
                        <Path HorizontalAlignment="Center" VerticalAlignment="Center" Fill="#2A2A2A" Data="{Binding Path=Content,RelativeSource={RelativeSource TemplatedParent}}" />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter TargetName="Border" Property="Background" Value="{StaticResource PressedBrush}" />
                        </Trigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <Style x:Key="ScrollBarPageButton" TargetType="{x:Type RepeatButton}">
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="IsTabStop" Value="false"/>
        <Setter Property="Focusable" Value="false"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RepeatButton}">
                    <Border Background="Transparent" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ScrollBarThumb" TargetType="{x:Type Thumb}">
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="IsTabStop" Value="false"/>
        <Setter Property="Focusable" Value="false"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Thumb}">
                    <Border CornerRadius="2" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--垂直-->
    <ControlTemplate x:Key="VerticalScrollBar" TargetType="{x:Type ScrollBar}">
        <Grid >
            <Grid.RowDefinitions>
                <RowDefinition MaxHeight="18"/>
                <RowDefinition Height="0.00001*"/>
                <RowDefinition MaxHeight="18"/>
            </Grid.RowDefinitions>
            <Border Grid.RowSpan="3" CornerRadius="2" Background="#F0F0F0" />
            <RepeatButton Grid.Row="0" Style="{StaticResource ScrollBarLineButton}" Height="18" Command="ScrollBar.LineUpCommand" Content="M 0 4 L 8 4 L 4 0 Z" />
            <Track  Name="PART_Track" Grid.Row="1" IsDirectionReversed="true">
                <Track.DecreaseRepeatButton>
                    <RepeatButton Style="{StaticResource ScrollBarPageButton}" Command="ScrollBar.PageUpCommand" />
                </Track.DecreaseRepeatButton>
                <Track.Thumb>
                    <Thumb Style="{StaticResource ScrollBarThumb}" Margin="1,0,1,0" Background="{StaticResource HorizontalNormalBrush}" BorderBrush="Silver" />
                </Track.Thumb>
                <Track.IncreaseRepeatButton>
                    <RepeatButton Style="{StaticResource ScrollBarPageButton}" Command="ScrollBar.PageDownCommand" />
                </Track.IncreaseRepeatButton>
            </Track>
            <RepeatButton Grid.Row="3" Style="{StaticResource ScrollBarLineButton}" Height="18" Command="ScrollBar.LineDownCommand" Content="M 0 0 L 4 4 L 8 0 Z"/>
        </Grid>
    </ControlTemplate>

    <!--水平-->
    <ControlTemplate x:Key="HorizontalScrollBar" TargetType="{x:Type ScrollBar}">
        <Grid >
            <Grid.ColumnDefinitions>
                <ColumnDefinition MaxWidth="18"/>
                <ColumnDefinition Width="0.00001*"/>
                <ColumnDefinition MaxWidth="18"/>
            </Grid.ColumnDefinitions>
            <Border Grid.ColumnSpan="3" CornerRadius="2" Background="#F0F0F0" />
            <RepeatButton Grid.Column="0" Style="{StaticResource ScrollBarLineButton}" Width="18" Command="ScrollBar.LineLeftCommand" Content="M 4 0 L 4 8 L 0 4 Z" />
            <Track Name="PART_Track" Grid.Column="1" IsDirectionReversed="False">
                <Track.DecreaseRepeatButton>
                    <RepeatButton Style="{StaticResource ScrollBarPageButton}" Command="ScrollBar.PageLeftCommand" />
                </Track.DecreaseRepeatButton>
                <Track.Thumb>
                    <Thumb Style="{StaticResource ScrollBarThumb}" Margin="0,1,0,1" Background="{StaticResource HorizontalNormalBrushBar}" BorderBrush="Silver" />
                </Track.Thumb>
                <Track.IncreaseRepeatButton>
                    <RepeatButton Style="{StaticResource ScrollBarPageButton}" Command="ScrollBar.PageRightCommand" />
                </Track.IncreaseRepeatButton>
            </Track>
            <RepeatButton Grid.Column="3" Style="{StaticResource ScrollBarLineButton}" Width="18" Command="ScrollBar.LineRightCommand" Content="M 0 0 L 4 4 L 0 8 Z"/>
        </Grid>
    </ControlTemplate>

    <Style x:Key="{x:Type ScrollBar}" TargetType="{x:Type ScrollBar}">
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Style.Triggers>
            <Trigger Property="Orientation" Value="Horizontal">
                <Setter Property="Width" Value="Auto"/>
                <Setter Property="Height" Value="18" />
                <Setter Property="Template" Value="{StaticResource HorizontalScrollBar}" />
            </Trigger>
            <Trigger Property="Orientation" Value="Vertical">
                <Setter Property="Width" Value="18"/>
                <Setter Property="Height" Value="Auto" />
                <Setter Property="Template" Value="{StaticResource VerticalScrollBar}" />
            </Trigger>
        </Style.Triggers>
    </Style>
    <!--滚动条样式结束-->

    <!--菜单样式开始-->
    <!--分隔条样式-->
    <Style x:Key="{x:Static MenuItem.SeparatorStyleKey}" TargetType="Separator">
        <!--<Setter Property="Height" Value="1"/>-->
        <Setter Property="Margin" Value="0,2,0,2"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Separator">
                    <Border BorderBrush="LightSlateGray" BorderThickness="0.3"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- 顶级菜单头样式 -->
    <ControlTemplate x:Key="{x:Static MenuItem.TopLevelHeaderTemplateKey}" TargetType="MenuItem">
        <Border Name="Border" >
            <Grid>
                <ContentPresenter Margin="6,3,6,3" ContentSource="Header" RecognizesAccessKey="True" />
                <Popup Name="Popup" Placement="Bottom" IsOpen="{TemplateBinding IsSubmenuOpen}" AllowsTransparency="True" Focusable="False" PopupAnimation="Fade">
                    <!--顶级菜单弹出的子菜单Border样式-->
                    <Border Name="SubmenuBorder" SnapsToDevicePixels="True" Background="{StaticResource WindowBackgroundBrush}" BorderBrush="{StaticResource SolidBorderBrush}" BorderThickness="1,0,1,1" >
                        <StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Cycle" />
                    </Border>
                </Popup>
            </Grid>
        </Border>
        <ControlTemplate.Triggers>
            <Trigger Property="IsSuspendingPopupAnimation" Value="true">
                <Setter TargetName="Popup" Property="PopupAnimation" Value="None"/>
            </Trigger>
            <Trigger Property="IsHighlighted" Value="false">
                <!--顶级菜单，未选中时的样式-->
                <Setter Property="Foreground" Value="#FFCFE8FC" />
                <Setter TargetName="Border" Property="BorderBrush" Value="Transparent"/>
                <Setter TargetName="Border" Property="BorderThickness" Value="1,1,1,0"/>
                <Setter TargetName="Border" Property="CornerRadius" Value="2,2,0,0"/>
            </Trigger>
            <Trigger Property="IsHighlighted" Value="true">
                <!--顶级菜单，选中时的样式-->
                <Setter Property="Foreground" Value="Black" />
                <Setter TargetName="Border" Property="Background" Value="{StaticResource NormalBrush}"/>
                <Setter TargetName="Border" Property="BorderBrush" Value="#AECFF7"/>
                <Setter TargetName="Border" Property="BorderThickness" Value="1,1,1,0"/>
                <Setter TargetName="Border" Property="CornerRadius" Value="2,2,0,0"/>
            </Trigger>
            <!--顶级菜单弹出的菜单样式-->
            <Trigger SourceName="Popup" Property="Popup.AllowsTransparency" Value="True">
                <Setter TargetName="SubmenuBorder" Property="CornerRadius" Value="0,0,4,4"/>
                <Setter TargetName="SubmenuBorder" Property="Padding" Value="0,2" />
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <!-- 顶级菜单样式：右键弹出一级菜单使用 -->
    <ControlTemplate x:Key="{x:Static MenuItem.TopLevelItemTemplateKey}" TargetType="MenuItem">
        <Border Name="Border" >
            <Grid>
                <ContentPresenter Margin="6,3,6,3" ContentSource="Header" RecognizesAccessKey="True" />
            </Grid>
        </Border>
        <ControlTemplate.Triggers>
            <Trigger Property="IsHighlighted" Value="false">
                <Setter Property="Foreground" Value="#FFCFE8FC" />
                <Setter TargetName="Border" Property="BorderBrush" Value="Transparent"/>
                <Setter TargetName="Border" Property="BorderThickness" Value="1,1,1,0"/>
                <Setter TargetName="Border" Property="CornerRadius" Value="2,2,0,0"/>
            </Trigger>
            <Trigger Property="IsHighlighted" Value="true">
                <Setter Property="Foreground" Value="Black" />
                <Setter TargetName="Border" Property="Background" Value="{StaticResource NormalBrush}"/>
                <Setter TargetName="Border" Property="BorderBrush" Value="#AECFF7"/>
                <Setter TargetName="Border" Property="BorderThickness" Value="1,1,1,0"/>
                <Setter TargetName="Border" Property="CornerRadius" Value="2,2,0,0"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <!-- 子菜单头样式 -->
    <ControlTemplate x:Key="{x:Static MenuItem.SubmenuHeaderTemplateKey}" TargetType="MenuItem">
        <Border Name="Border" >
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="28" SharedSizeGroup="Icon"/>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="Auto" SharedSizeGroup="Shortcut"/>
                    <ColumnDefinition Width="16"/>
                </Grid.ColumnDefinitions>
                <ContentPresenter Name="Icon" Margin="6,0,6,0" VerticalAlignment="Center" ContentSource="Icon"/>
                <ContentPresenter Name="HeaderHost" Grid.Column="1" ContentSource="Header" RecognizesAccessKey="True"/>
                <!--有子菜单的二级菜单-->
                <TextBlock x:Name="InputGestureText" Grid.Column="2" Text="{TemplateBinding InputGestureText}" Margin="5,4,2,4" DockPanel.Dock="Right"/>
                <Path Grid.Column="3" HorizontalAlignment="Center" VerticalAlignment="Center" Data="M 0 0 L 0 7 L 4 3.5 Z" Fill="{StaticResource GlyphBrush}" />
                <!--二级菜单弹出的子菜单-->
                <Popup Name="Popup" Placement="Right" HorizontalOffset="-1" IsOpen="{TemplateBinding IsSubmenuOpen}" AllowsTransparency="True" Focusable="False" PopupAnimation="Fade">
                    <Border Name="SubmenuBorder" SnapsToDevicePixels="True" Background="{StaticResource WindowBackgroundBrush}" BorderBrush="{StaticResource SolidBorderBrush}" BorderThickness="1" >
                        <StackPanel  IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Cycle" />
                    </Border>
                </Popup>
            </Grid>
        </Border>
        <ControlTemplate.Triggers>
            <Trigger Property="Icon" Value="{x:Null}">
                <Setter TargetName="Icon" Property="Visibility" Value="Collapsed"/>
            </Trigger>
            <Trigger Property="IsHighlighted" Value="true">
                <!--有子菜单的二级菜单，选中时的样式-->
                <Setter Property="Foreground" Value="Black" />
                <Setter TargetName="Border" Property="Background" Value="{StaticResource SelectedBackgroundBrush}"/>
                <Setter TargetName="Border" Property="BorderBrush" Value="#AECFF7"/>
                <Setter TargetName="Border" Property="BorderThickness" Value="1"/>
                <Setter TargetName="Border" Property="Margin" Value="2,0"/>
                <Setter TargetName="Border" Property="CornerRadius" Value="2"/>
            </Trigger>
            <Trigger Property="IsHighlighted" Value="false">
                <!--有子菜单的二级菜单，未选中时的样式-->
                <Setter TargetName="Border" Property="BorderBrush" Value="Transparent"/>
                <Setter TargetName="Border" Property="BorderThickness" Value="1"/>
                <Setter TargetName="Border" Property="Margin" Value="2,0"/>
                <Setter TargetName="Border" Property="CornerRadius" Value="2"/>
            </Trigger>
            <!--二级菜单弹出的子项样式-->
            <Trigger SourceName="Popup" Property="Popup.AllowsTransparency" Value="True">
                <Setter TargetName="SubmenuBorder" Property="CornerRadius" Value="4"/>
                <Setter TargetName="SubmenuBorder" Property="Padding" Value="0,2"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
                <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <!-- 菜单子项样式：右键弹出菜单使用 -->
    <ControlTemplate x:Key="{x:Static MenuItem.SubmenuItemTemplateKey}" TargetType="MenuItem">
        <Border Name="Border" >
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="28" SharedSizeGroup="Icon"/>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="Auto" SharedSizeGroup="Shortcut"/>
                    <ColumnDefinition Width="10"/>
                </Grid.ColumnDefinitions>
                <ContentPresenter Name="Icon" Margin="6,0,6,0" VerticalAlignment="Center" ContentSource="Icon" />
                <Border Name="Check" Width="13" Height="13" Visibility="Collapsed" Margin="6,0,6,0" Background="{StaticResource NormalBrush}" BorderThickness="1" BorderBrush="{StaticResource NormalBorderBrush}">
                    <Path Name="CheckMark" Width="7" Height="7" Visibility="Hidden" SnapsToDevicePixels="False" Stroke="{StaticResource GlyphBrush}" StrokeThickness="2" Data="M 0 0 L 7 7 M 0 7 L 7 0" />
                </Border>
                <ContentPresenter Name="HeaderHost" Grid.Column="1" ContentSource="Header" RecognizesAccessKey="True" />
                <TextBlock x:Name="InputGestureText" Grid.Column="2" Text="{TemplateBinding InputGestureText}" Margin="10,5,0,5" DockPanel.Dock="Right" />
            </Grid>
        </Border>
        <ControlTemplate.Triggers>
            <Trigger Property="Icon" Value="{x:Null}">
                <Setter TargetName="Icon" Property="Visibility" Value="Hidden"/>
            </Trigger>
            <Trigger Property="IsChecked" Value="true">
                <Setter TargetName="CheckMark" Property="Visibility" Value="Visible"/>
            </Trigger>
            <Trigger Property="IsCheckable" Value="true">
                <Setter TargetName="Check" Property="Visibility" Value="Visible"/>
                <Setter TargetName="Icon" Property="Visibility" Value="Hidden"/>
            </Trigger>
            <Trigger Property="IsHighlighted" Value="true">
                <Setter Property="Foreground" Value="Black" />
                <Setter TargetName="Border" Property="Background" Value="{StaticResource SelectedBackgroundBrush}"/>
                <Setter TargetName="Border" Property="BorderBrush" Value="#AECFF7"/>
                <Setter TargetName="Border" Property="BorderThickness" Value="1"/>
                <Setter TargetName="Border" Property="Margin" Value="2,0"/>
                <Setter TargetName="Border" Property="CornerRadius" Value="2"/>
            </Trigger>
            <Trigger Property="IsHighlighted" Value="false">
                <Setter TargetName="Border" Property="BorderBrush" Value="Transparent"/>
                <Setter TargetName="Border" Property="BorderThickness" Value="1"/>
                <Setter TargetName="Border" Property="Margin" Value="2,0"/>
                <Setter TargetName="Border" Property="CornerRadius" Value="2"/>
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
                <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <!-- MenuItem样式 -->
    <Style x:Key="{x:Type MenuItem}" TargetType="MenuItem">
        <Setter Property="OverridesDefaultStyle" Value="True"/>
        <!--所有文字颜色-->
        <Setter Property="Foreground" Value="Black" />
        <Style.Triggers>
            <Trigger Property="Role" Value="TopLevelHeader">
                <Setter Property="Template" Value="{StaticResource {x:Static MenuItem.TopLevelHeaderTemplateKey}}"/>
                <Setter Property="Grid.IsSharedSizeScope" Value="true"/>
            </Trigger>
            <Trigger Property="Role" Value="TopLevelItem">
                <Setter Property="Template" Value="{StaticResource {x:Static MenuItem.TopLevelItemTemplateKey}}"/>
            </Trigger>
            <Trigger Property="Role" Value="SubmenuHeader">
                <Setter Property="Template" Value="{StaticResource {x:Static MenuItem.SubmenuHeaderTemplateKey}}"/>
            </Trigger>
            <Trigger Property="Role" Value="SubmenuItem">
                <Setter Property="Template" Value="{StaticResource {x:Static MenuItem.SubmenuItemTemplateKey}}"/>
            </Trigger>
        </Style.Triggers>
    </Style>
    <!--菜单样式结束-->

    <!--ContextMenu样式-->
    <Style TargetType="{x:Type ContextMenu}">
        <Setter Property="SnapsToDevicePixels" Value="True"/>
        <Setter Property="OverridesDefaultStyle" Value="True"/>
        <Setter Property="Grid.IsSharedSizeScope" Value="true"/>
        <Setter Property="HasDropShadow" Value="True"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ContextMenu}">
                    <Border Name="Border" Background="{StaticResource WindowBackgroundBrush}" BorderBrush="{StaticResource SolidBorderBrush}" BorderThickness="1" >
                        <StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Cycle"/>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="HasDropShadow" Value="true">
                            <Setter TargetName="Border" Property="Padding" Value="0,3,0,3"/>
                            <Setter TargetName="Border" Property="CornerRadius" Value="4"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>

    </Style>

    <!--DataGrid样式-->
    <Style TargetType="{x:Type DataGrid}">
        <Setter Property="HeadersVisibility" Value="Column" />
        <Setter Property="Margin" Value="2" />
        <Setter Property="Background" Value="White" />
        <Setter Property="MinRowHeight" Value="27" />
        <Setter Property="AutoGenerateColumns" Value="False" />

        <!--以下两个属性实现垂直和水平线条颜色-->
        <!--<Setter Property="VerticalGridLinesBrush" Value="Transparent" />-->
        <!--<Setter Property="VerticalGridLinesBrush">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FF1D71AC" Offset="0" />
                    <GradientStop Color="#FF176199" Offset="0.5" />
                    <GradientStop Color="#FF114E83" Offset="1" />
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>-->
        <!--<Setter Property="HorizontalGridLinesBrush" Value="#C1D1FF" />-->
        <!--<Setter Property="HorizontalGridLinesBrush">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FF1D71AC" Offset="0" />
                    <GradientStop Color="#FF176199" Offset="0.5" />
                    <GradientStop Color="#FF114E83" Offset="1" />
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>-->

        <Setter Property="HorizontalGridLinesBrush" Value="Gray" />
        <Setter Property="VerticalGridLinesBrush" Value="Gray" />

        <!--先将所有行背景颜色设置为白色-->
        <Setter Property="RowBackground" Value="White" />
        <!--以下两个属性实现隔行不同颜色-->
        <!--AlternatingRowBackground为奇数行颜色（索引0开始），AlternationCount为每X行隔开-->
        <!--<Setter Property="AlternatingRowBackground" Value="#06808080" />-->
        <Setter Property="AlternatingRowBackground" Value="#C8FAF6FF" />
        <Setter Property="AlternationCount" Value="2" />
    </Style>

    <!--DataGridColumnHeader样式-->
    <Style TargetType="{x:Type DataGridColumnHeader}">
        <Setter Property="MinHeight" Value="34" />
        <!--<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FFFFFFFF" Offset="0" />
                    <GradientStop Color="#FFFCFCFC" Offset="0.5" />
                    <GradientStop Color="#FFF2F2F2" Offset="1" />
                </LinearGradientBrush>-->
        <!--<Setter Property="Background" Value="#457DBD">
        </Setter>-->
        <!--<Setter.Value>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FF1D71AC" Offset="0" />
                    <GradientStop Color="#FF176199" Offset="0.5" />
                    <GradientStop Color="#FF114E83" Offset="1" />
                </LinearGradientBrush>
            </Setter.Value>-->
        <Setter Property="Background">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FFFEFEFE" Offset="0" />
                    <GradientStop Color="#FFF2F2F2" Offset="0.5" />
                    <GradientStop Color="#FFE0E0E0" Offset="1" />
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <!--<Setter Property="Foreground" Value="White" />-->
        <Setter Property="Foreground" Value="Black" />
        <Setter Property="HorizontalContentAlignment" Value="Center" />
        <!--<Setter Property="BorderThickness" Value="0,0,0.3,0" />-->
        <Setter Property="BorderThickness" Value="0,0,0.5,0" />
        <!--<Setter Property="BorderBrush" Value="#FFC1D9EB" />-->
        <!--<Setter Property="BorderBrush" Value="White" />-->
        <Setter Property="BorderBrush" Value="Black" />
        <Setter Property="FontWeight" Value="Bold" />
    </Style>

    <!--DataGridRow通用样式-->
    <Style TargetType="{x:Type DataGridRow}">
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="true">
                <!--鼠标移动过的颜色#FFFFFEDD-->
                <Setter Property="Background">
                    <Setter.Value>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="#FFF5F9FD" Offset="0" />
                            <GradientStop Color="#FFF2F6FC" Offset="1" />
                            <GradientStop Color="#FFEEF4FB" Offset="0.191" />
                            <GradientStop Color="#FFE3EDF8" Offset="0.382" />
                            <GradientStop Color="#FFDBE8F7" Offset="0.586" />
                            <GradientStop Color="#FFEBF2FA" Offset="0.809" />
                        </LinearGradientBrush>
                    </Setter.Value>
                </Setter>
                <!--<Setter Property="Foreground" Value="White" />-->
            </Trigger>
        </Style.Triggers>
    </Style>

    <!--DataGridCell通用样式-->
    <Style TargetType="{x:Type DataGridCell}">
        <!--<Setter Property="BorderBrush" Value="{StaticResource ResourceKey=dataGridCellBorderBrush}"/>-->
        <Setter Property="BorderThickness" Value="0.5"/>
        <!--<Setter Property="ToolTip" Value="{Binding Content.Text, RelativeSource={RelativeSource Self}}" />-->
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type DataGridCell}">
                    <Grid Background="{TemplateBinding Background}">
                        <ContentPresenter VerticalAlignment="Stretch" Margin="1" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <!--鼠标选择时的颜色#2100CED1-->
            <Trigger Property="IsSelected" Value="true">
                <!--<Setter Property="Background" Value="{StaticResource commonBackground}" />-->
                <Setter Property="Background">
                    <Setter.Value>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="#FFFFECB5" Offset="0" />
                            <GradientStop Color="#FFFFFBED" Offset="0.1" />
                            <GradientStop Color="#FFFFF9E9" Offset="0.2" />
                            <GradientStop Color="#FFFFF7DF" Offset="0.3" />
                            <GradientStop Color="#FFFFF5D4" Offset="0.4" />
                            <GradientStop Color="#FFFFEFC2" Offset="0.5" />
                            <GradientStop Color="#FFFFECB5" Offset="1" />
                        </LinearGradientBrush>
                    </Setter.Value>
                </Setter>
                <!--<Setter Property="Background" Value="#FFFFFFCC" />-->
                <Setter Property="Foreground" Value="#952B00" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <!--TreeView样式-->
    <Style x:Key="TreeViewItemFocusVisual">
        <Setter Property="Control.Template">
            <Setter.Value>
                <ControlTemplate>
                    <Rectangle/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <StreamGeometry x:Key="TreeArrow" >M0.5,0L0.5,7 4.5,3.5z</StreamGeometry>
    <Style x:Key="ExpandCollapseToggleStyle" TargetType="{x:Type ToggleButton}">
        <Setter Property="Focusable" Value="False"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ToggleButton}">
                    <Border Background="Transparent">
                        <Path x:Name="ExpandPath" Data="{StaticResource TreeArrow}" Fill="Transparent" Stroke="#FF989898" Margin="0,2,5,0" HorizontalAlignment="Right" VerticalAlignment="Center"/>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsChecked" Value="True">
                            <Setter Property="RenderTransform" TargetName="ExpandPath">
                                <Setter.Value>
                                    <RotateTransform Angle="45" CenterX="0" CenterY="2.5"/>
                                </Setter.Value>
                            </Setter>
                            <Setter Property="Fill" TargetName="ExpandPath" Value="#FF595959"/>
                            <Setter Property="Stroke" TargetName="ExpandPath" Value="#FF262626"/>
                        </Trigger>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Stroke" TargetName="ExpandPath" Value="#FF1BBBFA"/>
                            <Setter Property="Fill" TargetName="ExpandPath" Value="Transparent"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Effect">
                    <Setter.Value>
                        <DropShadowEffect ShadowDepth="0" Color="#FF2CC8F8" BlurRadius="5"/>
                    </Setter.Value>
                </Setter>
            </Trigger>
        </Style.Triggers>
    </Style>

    <!--<Style TargetType="{x:Type TreeViewItem}" BasedOn="{StaticResource ExpandedTree}">
        <Setter Property="IsExpanded" Value="False" />
    </Style>-->

    <Style TargetType="{x:Type TreeViewItem}">
        <Setter Property="IsExpanded" Value="{Binding IsExpanded}" />
        <Setter Property="IsSelected" Value="{Binding IsSelected}" />
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
        <Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
        <Setter Property="Padding" Value="2,1"/>
        <!--<Setter Property="Margin" Value="1" />-->
        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
        <Setter Property="FocusVisualStyle" Value="{StaticResource TreeViewItemFocusVisual}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TreeViewItem}">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition MinWidth="19" Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                        <ToggleButton x:Name="Expander" ClickMode="Press" IsChecked="{Binding IsExpanded, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource ExpandCollapseToggleStyle}"/>
                        <Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Grid.Column="1" Padding="{TemplateBinding Padding}" CornerRadius="2">
                            <Border x:Name="InnerBd" BorderThickness="1" CornerRadius="1">
                                <ContentPresenter x:Name="PART_Header" ContentSource="Header" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="0,-1,0,0"/>
                            </Border>
                        </Border>
                        <ItemsPresenter x:Name="ItemsHost" Grid.ColumnSpan="2" Grid.Column="1" Grid.Row="1"/>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsExpanded" Value="false">
                            <Setter Property="Visibility" TargetName="ItemsHost" Value="Collapsed"/>
                        </Trigger>
                        <Trigger Property="HasItems" Value="false">
                            <Setter Property="Visibility" TargetName="Expander" Value="Hidden"/>
                        </Trigger>
                        <Trigger SourceName="Bd" Property="IsMouseOver" Value="True">
                            <Setter Property="Background" TargetName="Bd">
                                <Setter.Value>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="#FFFAFBFD" Offset="0"/>
                                        <GradientStop Color="#FFEBF3FD" Offset="1"/>
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter Property="BorderBrush" Value="#FFB8D6FB"/>
                            <Setter Property="BorderBrush" TargetName="InnerBd">
                                <Setter.Value>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="#FFFCFDFE" Offset="0"/>
                                        <GradientStop Color="#FFF2F7FE" Offset="1"/>
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                        <Trigger Property="IsSelected" Value="true">
                            <Setter Property="Background" TargetName="Bd">
                                <Setter.Value>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="#FFECF5FF" Offset="0"/>
                                        <GradientStop Color="#FFD0E5FF" Offset="1"/>
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter Property="BorderBrush" Value="#FF84ACDD"/>
                            <Setter Property="BorderBrush" TargetName="InnerBd">
                                <Setter.Value>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="#FFF2F8FF" Offset="0"/>
                                        <GradientStop Color="#FFDFEEFF" Offset="1"/>
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <!--<Setter Property="FontWeight" Value="Bold" />-->
                        </Trigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsSelected" Value="true"/>
                                <Condition Property="IsSelectionActive" Value="false"/>
                            </MultiTrigger.Conditions>
                            <Setter Property="Background" TargetName="Bd">
                                <Setter.Value>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="#FFF9F9F9" Offset="0"/>
                                        <GradientStop Color="#FFE6E6E6" Offset="1"/>
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                            <Setter Property="BorderBrush" Value="#FFDADADA"/>
                            <Setter Property="BorderBrush" TargetName="InnerBd">
                                <Setter.Value>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="#FFFBFBFC" Offset="0"/>
                                        <GradientStop Color="#FFF1F1F1" Offset="1"/>
                                    </LinearGradientBrush>
                                </Setter.Value>
                            </Setter>
                        </MultiTrigger>
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="VirtualizingStackPanel.IsVirtualizing" Value="true">
                <Setter Property="ItemsPanel">
                    <Setter.Value>
                        <ItemsPanelTemplate>
                            <VirtualizingStackPanel/>
                        </ItemsPanelTemplate>
                    </Setter.Value>
                </Setter>
            </Trigger>
        </Style.Triggers>
    </Style>

    <!--TabControl样式开始-->
    <!--TAB通用样式-->
    <Style  TargetType="{x:Type TabControl}">
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="Margin" Value="2" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TabControl}">
                    <Grid ClipToBounds="True" SnapsToDevicePixels="True" KeyboardNavigation.TabNavigation="Local">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition x:Name="ColumnDefinition0"/>
                            <ColumnDefinition x:Name="ColumnDefinition1" Width="0"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition x:Name="RowDefinition0" Height="Auto"/>
                            <RowDefinition x:Name="RowDefinition1" Height="*"/>
                        </Grid.RowDefinitions>
                        <ScrollViewer VerticalScrollBarVisibility="Disabled" HorizontalScrollBarVisibility="Auto" Template="{DynamicResource ScrollViewerTemplate}">
                            <TabPanel x:Name="HeaderPanel" Margin="2,2,2,0" IsItemsHost="True" Panel.ZIndex="1" Grid.Column="0" Grid.Row="0" KeyboardNavigation.TabIndex="1"/>
                        </ScrollViewer>
                        <Border BorderThickness="1" Grid.Row="1" BorderBrush="#FFF3F6FA" Background="#F5F0F8FF">
                            <!--#FFF3F6FA-->
                            <Border BorderThickness="1" BorderBrush="#FF8DB2E3" CornerRadius="1" Margin="1">
                                <!--内容框-->
                                <ContentPresenter ContentSource="SelectedContent" Margin="0"/>
                            </Border>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--TabItem样式-->
    <Style TargetType="{x:Type TabItem}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TabItem}">
                    <Grid>
                        <Border Name="Border" Margin="0,0,-2,0" Background="WhiteSmoke" BorderBrush="SlateGray" BorderThickness="1,1,1,1" CornerRadius="5,2,0,0">
                            <ContentPresenter x:Name="ContentSite" VerticalAlignment="Center" HorizontalAlignment="Center" ContentSource="Header" Margin="12,3" RecognizesAccessKey="True"/>
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsSelected" Value="True">
                            <Setter Property="Panel.ZIndex" Value="100" />
                            <Setter TargetName="Border" Property="Background" Value="White" />
                            <Setter TargetName="Border" Property="Margin" Value="0,-2,-2,0" />
                            <Setter TargetName="Border" Property="BorderThickness" Value="1,1,1,0" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--特殊的TabItem样式（文字四周宽度减小）-->
    <Style TargetType="{x:Type TabItem}" x:Key="SepTabItem">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type TabItem}">
                    <Grid>
                        <Border Name="Border" Margin="0,0,-2,0" Background="WhiteSmoke" BorderBrush="SlateGray" BorderThickness="1,1,1,1" CornerRadius="5,2,0,0">
                            <ContentPresenter x:Name="ContentSite" VerticalAlignment="Center" HorizontalAlignment="Center" ContentSource="Header" Margin="5,3" RecognizesAccessKey="True"/>
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsSelected" Value="True">
                            <Setter Property="Panel.ZIndex" Value="100" />
                            <Setter TargetName="Border" Property="Background" Value="White" />
                            <Setter TargetName="Border" Property="Margin" Value="0,-2,-2,0" />
                            <Setter TargetName="Border" Property="BorderThickness" Value="1,1,1,0" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--TabControl左右移动的箭头-->
    <ControlTemplate x:Key="HorizontalScrollBarTemplate" TargetType="{x:Type ScrollBar}">
        <Grid x:Name="Bg" SnapsToDevicePixels="True" Background="Transparent">
            <Grid.ColumnDefinitions>
                <ColumnDefinition MaxWidth="{DynamicResource {x:Static SystemParameters.HorizontalScrollBarButtonWidthKey}}"/>
                <ColumnDefinition Width="1E-05*"/>
                <ColumnDefinition MaxWidth="{DynamicResource {x:Static SystemParameters.HorizontalScrollBarButtonWidthKey}}"/>
            </Grid.ColumnDefinitions>
            <RepeatButton IsEnabled="{TemplateBinding IsMouseOver}" Command="ScrollBar.PageLeftCommand">
                <RepeatButton.Style>
                    <Style TargetType="{x:Type RepeatButton}">
                        <Setter Property="OverridesDefaultStyle" Value="True"/>
                        <Setter Property="Focusable" Value="False"/>
                        <Setter Property="IsTabStop" Value="False"/>
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="{x:Type RepeatButton}">
                                    <Border Background="#FF467DBD" Height="20" Width="15" >
                                        <Path Data=" M 8 15 L 8 3 L 2 9 Z" Fill="White" />
                                    </Border>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                    </Style>
                </RepeatButton.Style>
            </RepeatButton>
            <RepeatButton IsEnabled="{TemplateBinding IsMouseOver}" Command="ScrollBar.PageRightCommand" Grid.Column="2">
                <RepeatButton.Style>
                    <Style TargetType="{x:Type RepeatButton}">
                        <Setter Property="OverridesDefaultStyle" Value="True"/>
                        <Setter Property="Focusable" Value="False"/>
                        <Setter Property="IsTabStop" Value="False"/>
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="{x:Type RepeatButton}">
                                    <Border Background="#FF467DBD" Height="20" Width="15" >
                                        <Path Data=" M 9 15 L 9 3 L 15 9 Z" Fill="White" />
                                    </Border>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                    </Style>
                </RepeatButton.Style>
            </RepeatButton>
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Background" TargetName="Bg" Value="Transparent"/>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <!--TabItem滚动-->
    <ControlTemplate x:Key="ScrollViewerTemplate" TargetType="{x:Type ScrollViewer}">
        <Grid x:Name="Grid" Background="Transparent">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="*"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <Rectangle x:Name="Corner" Fill="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" Grid.Column="1" Grid.Row="1"/>
            <ScrollBar x:Name="PART_HorizontalScrollBar" Cursor="Arrow" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Grid.Column="0" Grid.Row="0" Orientation="Horizontal" ViewportSize="{TemplateBinding ViewportWidth}" Maximum="{TemplateBinding ScrollableWidth}" Minimum="0" Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" AutomationProperties.AutomationId="HorizontalScrollBar" Template="{DynamicResource HorizontalScrollBarTemplate}"/>
            <ScrollContentPresenter x:Name="PART_ScrollContentPresenter" Margin="15,2,15,0" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" Grid.Column="0" Grid.Row="0" CanContentScroll="{TemplateBinding CanContentScroll}" CanHorizontallyScroll="False" CanVerticallyScroll="False"/>
        </Grid>
    </ControlTemplate>
    <!--TabControl样式结束-->
</ResourceDictionary>